-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: Fix more browser tests #9183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix more browser tests #9183
Conversation
| }); | ||
|
|
||
| test('Redo block deletion', async function () { | ||
| // TODO(#9029) enable this test once deleting a block doesn't lose focus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed in #9195, can this be reenabled now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/browser/test/test_setup.mjs
Outdated
| for (const input of block.inputList) { | ||
| for (const field of input.fieldRow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a recently-ish introduced getFields() that returns a generator that might be more convenient here, but not a blocker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/browser/test/test_setup.mjs
Outdated
| while (!(await elementInBounds(browser, flyoutBlock))) { | ||
| await scrollFlyout(browser, 0, 50); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use WorkspaceSvg.scrollBoundsIntoView(flyoutBlock.getBoundingRectangleWithoutChildren()) rather than scrolling repeatedly by a fixed amount until it's on screen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would seemingly allow you to get rid of elementInBounds, since it should be safe to do unconditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took some reworking of a few of the test methods, but does seem to be cleaner and work better overall. =)
| return vertInView && horInView; | ||
| }, element); | ||
| // Unicode escape to close flyout. | ||
| await browser.keys(['\uE00C']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be webdriverio.Key.Escape?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here and elsewhere.
- Switch to using scrollBoundsIntoView instead of scrolling the flyout - Use webdriverio Key.Escape instead of the string code for it
RoboErikG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated based on comments
| }); | ||
|
|
||
| test('Redo block deletion', async function () { | ||
| // TODO(#9029) enable this test once deleting a block doesn't lose focus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/browser/test/test_setup.mjs
Outdated
| for (const input of block.inputList) { | ||
| for (const field of input.fieldRow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/browser/test/test_setup.mjs
Outdated
| while (!(await elementInBounds(browser, flyoutBlock))) { | ||
| await scrollFlyout(browser, 0, 50); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took some reworking of a few of the test methods, but does seem to be cleaner and work better overall. =)
| return vertInView && horInView; | ||
| }, element); | ||
| // Unicode escape to close flyout. | ||
| await browser.keys(['\uE00C']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here and elsewhere.
The basics
This fixes the remaining browser tests
The details
Resolves
Fixes #8953
Proposed Changes
Lots of fixes to the browser tests
Reason for Changes
Test Coverage
Documentation
Additional Information